package com.regent.central.infrastructure.common;

import org.apache.commons.codec.binary.Hex;

import java.util.UUID;

/**
 * UUID生成工具
 *
 * @author 杨昌沛 646742615@qq.com
 * @date 2018-06-19 10:21
 **/
public abstract class Uid {

    public static String random() {
        final byte[] uid = UUID.randomUUID().toString().getBytes();
        final byte[] md5 = Md5.encodeMd5(uid);
        final char[] hex = Hex.encodeHex(md5);
        return new String(hex);
    }

}
